﻿using CPPEI.Coolzon.UI;
using CPPEI.Coolzon.UI.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.Designer.Views
{
    public class UIContext
    {
        private static UIContext s_current = null;

        public static UIContext Current
        {
            get
            {
                if (s_current == null)
                {
                    s_current = new UIContext();
                }

                return s_current;
            }
        }

        public View MainView { get; set; }

        /// <summary>
        /// 
        /// 当前操作的方案信息
        /// </summary>
        public Coolzon.Designtime.Metadata.Solution CurrentSolution { get; set; }

        /// <summary>
        /// 当前操作的场景
        /// </summary>
        public Coolzon.Designtime.Metadata.Scene CurrentScene { get; set; }

        public bool IsShowActiveXPart { get; set; }

        /// <summary>
        /// 身份识别
        /// </summary>
        public string Token { get; set; }
        /// <summary>
        /// 电脑信息
        /// </summary>
        public string ComputerName { get; set; }

        public string UserAccount { get; set; }
        public string UserName { get; set; }

        public Designtime.Metadata.LocalWorkSpace LocalWorkSpace { get; set; }

        public SolutionTreeViewNode SolutionNode { get; set; }
        /// <summary>
        /// 当前选中节点
        /// </summary>
        public SolutionTreeViewNode CurrentSelectedNode { get; set; }

        /// <summary>
        /// 当前编辑节点
        /// </summary>
        public SolutionTreeViewNode CurrentEditedNode { get; set; }

        public DesignView CurrentDesignView { get; set; }

        public bool IsEditTemplateMode { get; set; }

        public Xceed.Wpf.AvalonDock.DockingManager DockingManager { get; set; }

        private UIContext()
        {
            IsShowActiveXPart = false;
        }
    }
}
